//3099.哈沙德数
//https://leetcode.cn/problems/harshad-number
class Solution {
public:
    int sumOfTheDigitsOfHarshadNumber(int x) {
        int sum = 0;
        for(int i = x;i;i/=10) sum += i%10;
        return x%sum==0?sum:-1;
    }
};